package com.study.mvc.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.study.mvc.action.base.Action;
import com.study.mvc.annotation.Controller;
import com.study.mvc.annotation.FormBean;
import com.study.mvc.annotation.Forward;
import com.study.mvc.annotation.RequestMapping;
import com.study.mvc.bean.LoginForm;
import com.study.mvc.bean.RegForm;
import com.study.mvc.bean.base.ActionForm;

@Controller
@RequestMapping("/reg")
@Forward(chenggong = "login.jsp", shibai = "reg.jsp")
@FormBean(clasz = "com.study.mvc.bean.RegForm", beanName = "reg")
public class RegAction implements Action {

	public RegAction() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public String excute(HttpServletRequest request,HttpServletResponse response,ActionForm form,Map<String,String> forwordMap) {
		
		RegForm regForm=(RegForm)form;
		String rstStr="";
		if(regForm.getPassword().equals("")){
			
			rstStr="shibai";
		}else{
			rstStr="chenggong";
		}
		
		return forwordMap.get(rstStr);
	}

}
